from business.base import Base
from public.address import OrderUrl


class Order(Base):
    def order_buy(self,item_id,remark=None,use_integal=None):
        json_data = {
            "goods": [
                {
                    "item_id": item_id,
                    "num": 1
                }
            ],
            "remark":remark,
            "action": "submit",
            "type": "card",
            "address_id": 2976,
            "use_integal":use_integal,
            "order_source": "6",
            "delivery_type": 1
        }
        res_code, response = self.send_requests("post", url=OrderUrl.OrderUrl_Account_Buy, json=json_data)
        return res_code, response